package com.woniu.service.productcommand;

import com.woniu.inlet.fo.ProAddFo;
import com.woniu.util.ApplicationContextHolder;
import lombok.Data;

/**
 * @description:
 * @author: my
 * @time: 2021/5/7 14:44
 */
@Data
public class AddProductCommand {
    private AddProductCommandHandler handler;
    private ProAddFo proAddFo;

    public AddProductCommand(){
        this.handler =
                ApplicationContextHolder.getApplicationContext().getBean(AddProductCommandHandler.class);
    }

    public AddProductCommand(ProAddFo proAddFo){
        this();
        this.proAddFo = proAddFo;
    }

    public void execute(){
        this.handler.action(this);
    }

}
